<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h1 v-pre>学习vue太容易了</h1>
        <h1 v-pre>当前n的值是：{{n}}</h1>
        <button @click="btn()" v-pre>点我n+1</button>
    </div>
    <script>
        Vue.config.productionTip = false;
        let vm = new Vue({
            el: '#root',
            data: {
                n:1,
            },
            methods: {
                btn(){
                    this.n++;
                }
            },
        });
    </script>
</body>
</html>